package com.teradyne.phoenix.client;

import com.google.gwt.place.shared.PlaceController;
import com.teradyne.phoenix.client.factory.AppFactory;
import com.teradyne.phoenix.client.places.RolesPlace;
import com.teradyne.phoenix.client.places.UserPlace;
import com.teradyne.phoenix.client.views.AppMenuView;
import com.teradyne.phoenix.client.views.AppMenuViewImpl;

public class AppController implements AppMenuView.Presenter {

	private AppFactory appFactory;
	private final PlaceController placeController;
	private AppMenuViewImpl appMenu;
	public AppController(AppFactory appFactory) {
		this.appFactory = appFactory;
		placeController = appFactory.getPlaceController();
		appMenu = appFactory.getAppMenuViewImpl();
		appMenu.setPresenter(this);
	}

	@Override
	public void gotoUserPlace() {
		placeController.goTo(new UserPlace());
		
	}

	@Override
	public void gotoRolesPlace() {
		placeController.goTo(new RolesPlace());
	}
}